#ifndef __SVMA_H
#define __SVMA_H
#include "stdtype.h"
#include "mxsetup.h"

#define MX_KERNEL_V2P(va) (va + MX_KERNEL_VPOFF)
#define MX_KERNEL_P2V(pa) (pa - MX_KERNEL_VPOFF)

/* svma memory space type definition */
typedef struct
{
    mx_void_pt start;
    mx_usize_t size;
    mx_void_pt end;
    mx_void_pt apointer;    // allocation pointer
} mx_svma_tbm_t, *mx_svma_tbm_pt;

mx_void_pt mx_svma_tbm_alloc (mx_usize_t size);
void mx_svma_tbm_free (mx_usize_t size);
mx_void_pt mx_svma_heap_alloc (void);
void mx_svma_heap_free (mx_void_pt addr);

#endif
